package com.mushuroom.live.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mushroom_street.live.pojo.LiveProduct;
import com.mushuroom.live.dao.LiveProductDao;
import com.mushuroom.live.service.LiveProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class LiveProductServiceImp implements LiveProductService {
    @Resource
    private LiveProductDao liveProductDao;
    @Override
    public List<LiveProduct> loadLiveProductByLiveId(String liveId) {

        //构建查询条件
        QueryWrapper<LiveProduct> querywrapper = new QueryWrapper<>();
        //liveId等于表中live_id
        querywrapper.eq("live_id",liveId);

        List<LiveProduct> liveProducts=liveProductDao.selectList(querywrapper);

        return liveProducts;
    }
}
